<%--
  Created by IntelliJ IDEA.
  User: 86183
  Date: 2019/8/24
  Time: 11:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath(); %>
<jsp:include page="/manage/inc/header"></jsp:include>
<link rel="stylesheet" type="text/css" href="<%=path%>/Manage/static/css/shou.css"/>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div class="main-wrap">

    <div class="crumb-wrap">

        <div class="crumb-list"><i class="icon-font"></i><a href="${pageContext.request.contextPath}/manage">首页</a><span class="crumb-step">&gt;</span><a href="${pageContext.request.contextPath}/manage/show/loser">遗失者管理</a>   &nbsp;&nbsp;&nbsp;&nbsp;             </span><a class="weishenhe" style="color: #ff231e" href="#">(未审核)</a>       </div>
    </div>
    <div class="search-wrap">
        <div class="search-content">
            <form action="#" method="post">
                <table class="search-tab">
                    <tr>
                        <th width="120">选择分类:</th>
                        <td>
                            <select id="leixing">
                                <option>请选择</option>
                                <option value="1">寻家者</option>
                                <option value="2">寻亲者</option>
                                <option value="3">用户帮发</option>
                            </select>
                        </td>
                        <th width="70">搜索:</th>
                        <td><input class="common-text" placeholder="搜索" name="keywords"  id="matter" type="text"></td>
                        <td><input class="btn btn-primary btn2" name="sub" value="查询" id="seek" type="button"></td>



                    </tr>
                </table>
            </form>
        </div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="myform" method="post">
            <div class="result-title">

            </div>
            <div class="result-content" id="show">


            </div>
        </form>
    </div>
</div>
<!--/main-->
</div>
<jsp:include page="/manage/inc/footer"></jsp:include>


<script>

    $(function () {

        initData(1);

    })
    $(function () {
        $("#show").on("click",".weitongguo",function () {
            var id = $(this).data("id3")
            layer.prompt({
                formType: 2,
                title: '请输入驳回理由'
            }, function(value, index, elem){
                var enable=0;
                var action= "${pageContext.request.contextPath}/manage/show/verified";
                var news = value;
                $.ajaxSettings.async = false;
                $.post(action,{enable:enable ,news:news,id:id},function () {
                    layer.close(index);
                    layer.confirm("确认驳回此申请吗",function () {
                        var url="<%=path%>/manage/volunteerReject"
                        $.post(url,{id:id},function (mes) {
                            layer.msg("申请已驳回")
                        })
                    })
                    initData(pageNum);
                })

            });
        })
    })



    function initData(pageNum)
    {
        var pageNum = {pageNum: pageNum};
        $.post("${pageContext.request.contextPath}/manage/ajaxJsp/losershow", pageNum, function (mes) {
                $("#show").html(mes);
            }
        );

    }
    $("#leixing").change(function () {
           var lostTypeId= $("#leixing").val();
            var action ="${pageContext.request.contextPath}/manage/ajaxJsp/lookupType";
          $.post(action,{lostTypeId:lostTypeId},function (mes) {
              $("#show").html(mes);
          })
    })

    $(".weishenhe").click(function () {
        var action ="${pageContext.request.contextPath}/manage/ajaxJsp/auditShow";
        $.post(action,function (mes) {
            $("#show").html(mes);
        })



    })
    $("#seek").click(function () {
        var action ="${pageContext.request.contextPath}/manage/ajaxJsp/findLoserShow";
        var name =$("#matter").val();
        if (name!=null)
        {
            $.post(action,{name:name},function (mes) {
                $("#show").html(mes);
            })

        }
        else {
            return;
        }





    })

</script>